#ifndef _FUTURE_H_
#define _FUTURE_H_

#include <pthread.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    pthread_mutex_t mutex;
    pthread_cond_t cond;
    int value;
    int is_ready;
} Future_t;

void FutureInit(Future_t* future);

void FutureDestroy(Future_t* future);

void FutureSetValue(Future_t* future, int value);

int FutureGetValue(Future_t* future);

#ifdef __cplusplus
}
#endif

#endif